<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<ul id="ul1">
			<li>No.1</li>
			<li>No.2</li>
			<li>No.3</li>
			<li>No.4</li>
		</ul>
		
		<script type="text/javascript">
			//获取ul节点
			var ul = document.getElementById("ul1");
			//获取ul的节点名称
			document.write("ul的节点名称："+ul.nodeName);
			document.write("<br/>ul的节点类型是："+ul.nodeType);
			
			//获取No.1
			var no1 = ul.firstElementChild.firstChild.nodeName;
			document.write("<br/>文本的节点名称是："+no1);
			var no1type = ul.firstElementChild.firstChild.nodeType;
			document.write("<br/>文本的节点类型是："+no1type);
			//获取文本节点的值
			var no1value = ul.firstElementChild.firstChild.nodeValue;
			document.write("<br/>文本的节点值是："+no1value);
		</script>
	</body>
</html>
